package com.gin.pixiv.enums

import com.fasterxml.jackson.annotation.JsonCreator

/**
 * 限制级别
 * @author bx002
 * @since 2024/2/18 14:48
 */
enum class XRestrict {
    /**
     * 常规
     */
    NORMAL,

    /**
     * r18
     */
    R_18,

    /**
     * r18g
     */
    R_18G,

    ;

    companion object {
        @JsonCreator
        @JvmStatic
        fun creator(i: Int): XRestrict {
            return when (i) {
                0 -> NORMAL
                1 -> R_18
                2 -> R_18G
                else -> throw RuntimeException("unacceptable value: $i")
            }
        }
    }
}